﻿<?php

include("db_connection.php"); //db접속파일
global $connect;

//text_exe("net_eng"); //시험가동하는데 쓴다.

function text_exe($table_name){
    global $connect;
    $table_name = "$table_name";
    $sql = "select * from $table_name";
    echo $sql ;
    $rs = mysql_query($sql,$connect);

    while($result = mysql_fetch_array($rs)){
        $seq = $result[seq];
        $english_text = $result[english_text];
        $korean_text = $result[korean_text];
        $finish = $result[finish];
    
        $xmlList.="<paragraph><seq>$seq</seq><english_text>$english_text</english_text><korean_text>$korean_text</korean_text><finish>$finish</finish></paragraph>";
    }
    mysql_free_result($rs);
    $fp = fopen("$table_name.xml","w");
    $xmlDoc="<?xml version='1.0' encoding='UTF-8'?><root><$table_name>$xmlList</$table_name></root>";
    fputs($fp, $xmlDoc);
    fclose($fp);
}
?>
